package qwer;

import java.util.Scanner;
public class NO3 {

public static void main(String[] args) {

float num;
String s,str1;
int a;
Scanner in=new Scanner(System.in);
while(in.hasNextFloat()) 
{
    int result=0;
    num=in.nextFloat();
    s=Float.toString(num);
    char []Arr=s.toCharArray();
    for(int i=0;i<Arr.length;i++)
    {
        if(Arr[i]!='-'&&Arr[i]!='.')

        {
            result+=Arr[i]-'0';
        }
    }

    System.out.println(result);
}
}

}